<template>
   <div>
      <!-- navbar -->
      <MyNavBar></MyNavBar>
      <p v-html="content"></p>
   </div>
</template>

<script>
import { getNews } from "@api/newsApi";

import MyNavBar from "@components/MyNavBar.vue";

export default {
   components: {
      MyNavBar,
   },
   data() {
      return {
         content: null,
      };
   },

   /* 组件挂载时获取资讯数据 */
   mounted() {
      console.log("NewsView mounted");
      getNews().then(content => (this.content = content));
   },
};
</script>

<style>
.title {
   text-align: center;
}
</style>
